package yunplus.io.hchome.application;

import android.content.Context;
import android.content.SharedPreferences;
import android.util.Log;

import static android.content.ContentValues.TAG;

/**
 * Created by cruze on 2017/6/25.
 */

public class CamaraApp extends MyApplication {

    SharedPreferences preferences;

    @Override
    public void onCreate() {
        super.onCreate();
        preferences = this.getSharedPreferences("CAMARA", MODE_PRIVATE);
    }

    public void setData(String key, Object value) {
        if (value == null) {
            Log.i(TAG;"null cannt be put into a prefrance !");
            return;
        }
        SharedPreferences.Editor editor = preferences.edit();
        editor.putString(key, value.toString());
        editor.commit();
    }


    public Object getData(String key) {
        return preferences.getString(key, "");
    }


}
